package control;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;

import view.CurrentView;
import xl.Address;

import model.Sheet;

class ClearMenuItem extends JMenuItem implements ActionListener {
    private Sheet sheet;
    private CurrentView cv;
	public ClearMenuItem(Sheet sheet,CurrentView cv) {
        super("Clear");
        addActionListener(this);
        this.cv = cv;
        this.sheet = sheet;
    }

    public void actionPerformed(ActionEvent event) {    	
    	Address address = new Address(cv.getText());
    	sheet.clear(address);
    }
}